package com.lollipop.rabbitmqspringboot.consumer;

import com.lollipop.rabbitmqspringboot.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: Lollipop
 * @Date: 2021-10-20 21:35
 * @Description:
 */
@Slf4j
@Component
public class WarnConfumer {
    @RabbitListener(queues = ConfirmConfig.WARN_QUEUE_NAME)
    public void receiveWarnConfirmMessage(Message message) {
        String msg = new String(message.getBody());
        log.error("告警发现不可路由的消息：{}", msg);
    }
}
